﻿<!--
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.
-->

<Window x:Class="Coding4Fun.Chair.Diagnostic.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:local="clr-namespace:Coding4Fun.Chair.Diagnostic" 
        Title="Coding4Fun Jellybean Diagnostic Tool"
        SizeToContent="WidthAndHeight" 
        SnapsToDevicePixels="True" 
        WindowStartupLocation="CenterScreen"
        ResizeMode="NoResize" Icon="/Coding4Fun.Chair.Diagnostic;component/favicon.ico">
    <Grid Margin="10,10,0,0">

        <StackPanel>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <local:Thumbstick Grid.Column="0" x:Name="LeftThumbstick" Margin="10" />
                <local:Thumbstick Grid.Column="1" x:Name="RightThumbstick" Margin="10" />

                <Image Grid.Column="3" Margin="-30, 0, -20, 0" Source="/head.png" Stretch="None" VerticalAlignment="Bottom" HorizontalAlignment="Right" />

                <StackPanel Grid.Column="2" Margin="10,0" VerticalAlignment="Center">
                    <CheckBox Name="AButton" IsChecked="{Binding Path=IsAPressed, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type local:MainWindow}}}">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock FontSize="40" FontWeight="Bold" VerticalAlignment="Center" Margin="10,0">(A)</TextBlock>
                            <TextBlock FontSize="40" VerticalAlignment="Center">Up</TextBlock>
                        </StackPanel>
                    </CheckBox>
                    <CheckBox Name="BButton" IsChecked="{Binding Path=IsBPressed, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type local:MainWindow}}}">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock FontSize="40" FontWeight="Bold" VerticalAlignment="Center" Margin="10,0">(B)</TextBlock>
                            <TextBlock FontSize="40" VerticalAlignment="Center">Down</TextBlock>
                        </StackPanel>
                    </CheckBox>
                    <CheckBox Name="YButton" IsChecked="{Binding Path=IsYPressed, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type local:MainWindow}}}">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock FontSize="40" FontWeight="Bold" VerticalAlignment="Center" Margin="10,0">(Y)</TextBlock>
                            <TextBlock FontSize="40" VerticalAlignment="Center">Toggle</TextBlock>
                        </StackPanel>
                    </CheckBox>

                </StackPanel>
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <StackPanel>
                    <TextBlock FontWeight="Bold" FontSize="16" >Xbox Controller Status:</TextBlock>
                    <TextBlock Name="ControllerStatus" FontWeight="Bold" FontSize="16" Margin="25,0,0,5">Status</TextBlock>
                </StackPanel>
                <StackPanel Grid.Column="1">
                    <ComboBox>
                        <ComboBoxItem Name="rightSideCom">Right Motor Controller</ComboBoxItem>
                        <ComboBoxItem Name="leftSideCom">Left Motor Controller</ComboBoxItem>
                        <ComboBoxItem Name="Jelly" IsSelected="True">Jellybean</ComboBoxItem>
                    </ComboBox>
                    <Button Click="Button_Click">Start</Button>
                </StackPanel>
                <Image 
                    Grid.Column="3"
                    Source="/Coding4FunTextOnly.png" 
                    Stretch="None"
                    HorizontalAlignment="Right"
                    VerticalAlignment="Bottom"
                    Margin="5,0"/>
            </Grid>
        </StackPanel>

    </Grid>
</Window>
